package com.xiaoshuidi.cloud.module.member.controller.app.point.vo;

import com.alibaba.excel.util.StringUtils;
import com.xiaoshuidi.cloud.module.member.enums.point.PointChangeEnums;
import com.xiaoshuidi.cloud.module.member.enums.point.PointChangeValueEnums;
import com.xiaoshuidi.cloud.module.member.enums.point.PointRecordEnums;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

/**
 * @description 租客积分记录Vo实体
 * @author neil
 * @date 2022-12-14 18:08:07
 * @version generator
 */
@Data
public class TenantPointsRecordVo {

	/**
	 * id
	 */
	@Schema(description = "id")
	private Long id;
	/**
	 * 租客id
	 */
	@Schema(description = "租客id")
	private String tenantUserId;

	/**
	 * 租客account
	 */
	@Schema(description = "租客account")
	private String account;
	/**
	 * 租客account
	 */
	@Schema(description = "被邀请人手机号")
	private String inviteAccount;

	/**
	 * 积分流水号
	 */
	@Schema(description = "积分流水号")
	private String recordNo;
	/**
	 * 记录类型，0手动，1租金 ，2交易，3大转盘
	 */
	@Schema(description = "记录类型，0手动，1租金 ，2交易，3大转盘，4生日")
	private Integer recordType;
	private String recordTypeStr;
	/**
	 * 发放类型，0手动 1自动
	 */
	@Schema(description = "发放类型，0手动 1自动")
	private Integer changeType;
	private String sendType;
	/**
	 * 增减项，0减项，1增项
	 */
	@Schema(description = "增减项，0减项，1增项")
	private Integer changeValueType;
	private String changeValueTypeStr;
	/**
	 * 增减值
	 */
	@Schema(description = "增减值")
	private Long changeValue;
	/**
	 * 变动前积分
	 */
	@Schema(description = "变动前积分")
	private Long beforeChangePoints;
	/**
	 * 变动后积分
	 */
	@Schema(description = "变动后积分")
	private Long afterChangePoints;
	/**
	 * 创建时间
	 */
	@Schema(description = "创建时间")
	private Date createTime;
	/**
	 * 更新时间
	 */
	@Schema(description = "更新时间")
	private Date updateTime;
	/**
	 * 创建人
	 */
	@Schema(description = "创建人")
	private String creator;
	/**
	 * 修改人
	 */
	@Schema(description = "修改人")
	private String updater;
	/**
	 * 备注
	 */
	@Schema(description = "备注")
	private String remark;
	public String getRecordTypeStr() {
		if(PointRecordEnums.getPointRecordEnumsByValue(recordType) != null){
			return PointRecordEnums.getPointRecordEnumsByValue(recordType).msg;
		}else{
			return StringUtils.EMPTY;
		}
	}

	public String getChangeTypeStr() {
		if(PointChangeEnums.getMsgByKey(changeType) != null){
			return PointChangeEnums.getMsgByKey(changeType);
		}else{
			return StringUtils.EMPTY;
		}
	}

	public String getChangeValueTypeStr() {
		if(PointChangeValueEnums.getMsgByKey(changeValueType) != null){
			return PointChangeValueEnums.getMsgByKey(changeValueType);
		}else{
			return StringUtils.EMPTY;
		}
	}
}
